﻿using System;
using System.Collections.Generic;
using Battle.Engine.LogicModel;

namespace Battle.Engine
{
    public class BaseCompute
    {
        public EngineData data;   //公用数据

        //设置逻辑层通知外界的回调接口
        public virtual void SetCallback(EngineCallback callback)
        {

        }

        public virtual void Start()
        {

        }

        public virtual void Pause()
        {

        }

        public virtual void Continue() {

        }

        //停止
        public virtual void Stop()
        {

        }

        //开始下一个回合
        public virtual void NextRound()
        {

        }

        //外层控制回合结束
        public virtual void FinishRound()
        {

        }

        //使用技能
        public virtual void DoSkill(CampType camp, string uniquedId, int index)
        {

        }

        //换阵
        public virtual void DoTrans(List<string> uids, List<int> fpids)
        {

        }

        //获得释放技能和换阵的操作记录
        public virtual void GetRecordOperates(CampType camp, out List<FOperateSkill> skills, out List<FOperateTrans> transs)
        {
            skills = new List<FOperateSkill>();
            transs = new List<FOperateTrans>();
        }

        public virtual void SetReplayOperates(CampType camp, List<FOperateSkill> skills, List<FOperateTrans> transs)
        {

        }

        public virtual bool Update(double deltaTime)
        {
            return true;
        }

        //内部回调,战斗开始
        public virtual void BattleBegin()
        {

        }

        //内部回调,战斗结束,战斗结果
        public virtual void BattleEnd()
        {

        }

        //内部回调,回合开始
        public virtual void RoundBegin()
        {
        }

        //内部回调,回合结束
        public virtual void RoundEnd()
        {

        }

        //内部回调,技能开始
        public virtual void SkillBegin(FSkill skill, List<FActor> targets)
        {

        }

        //内部回调,技能结束
        public virtual void SkillEnd(CampType camp, string uniquedId, FSkill skill)
        {

        }

        //内部回调,技能伤害
        public virtual void SkillCast(FRelease release)
        {

        }

        //内部回调,技能发射
        public virtual void SkillProject(FRelease release)
        {

        }

        //actor进入死亡状态
        public virtual void ActorDead(FActor actor)
        {

        }

        //跳过
        public virtual void Skip()
        {

        }

        //跳过大招
        public virtual void SkipUltimate()
        {

        }

        //设置技能开关
        public virtual void SetSkill(CampType camp, string uniquedId, int skillIndex, bool enbale)
        {

        }

        //设置AI,只对真实战斗有效
        public virtual void SetAI(CampType camp, AI.EngineAI ai)
        {

        }

        //设置是否使用AI自动操作
        public virtual void SetAuto(CampType camp, bool auto)
        {

        }

        public virtual bool IsAuto(CampType camp)
        {
            return false;
        }

        public virtual bool IsSkipping() {
            return false;
        }

        //在没有技能发动中的时候回合结束, 只有当前回合有效
        public virtual void AutoFinishARound()
        {

        }

        public virtual EngineData GetEngineData()
        {
            return null;
        }

        //当前是否有激活的普通技能,如果都没有表示计入回合结束的倒计时
        public virtual bool HasActiveNormalSkill()
        {
            return false;
        }

        public virtual void NotifyCanFinishRound() {

        }

        public virtual void SetBuffsAtBattleBegin(CampType camp, List<string> buffIds)
        {

        }
    }
}
